package com.xsp.controller;

import com.xsp.exception.MyException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author xsp
 * @date 2024/2/20
 * @desc
 */
@Controller
@RequestMapping("book")
public class BookController {
    @RequestMapping("list")
    public String list() {
        int a = 10 / 0;
        return "booklist";
    }

    @RequestMapping("list1")
    public String list1() throws MyException {
        try {
            int a = 10 / 0;
            return "booklist";
        } catch (Exception e) {
            throw new MyException(e.getMessage(), e.getCause());
        }
    }
}
